﻿<?php
class labelMod extends commonMod
{
    public function __construct()
    {
        parent::__construct();

    }
    //列表调用
    public function getlist($html)
    {
        $html = stripslashes($html);
		
        preg_match_all('/(\S+)=\((.*)\)/iU', $html, $matches);
		
        $get = array_combine($matches[1], $matches[2]);
        $table = $get['table'];
        $field = $get['field']?$get['field']:'*';
        $limit = $get['limit'];
        $desc = $get['order'];
        $condition = $get['where']; //条件
        return $list = $this->model->field($field)->table($table)->where($condition)->limit($limit)->order($desc)->select(); //通用
    }

   //碎片显示
    public function fragment($sign)
    {
        $sign=in($sign);
        $info = $this->model->field('content')->table('fragment')->where('sign="'.$sign.'"')->find();
        $info['content'] = html_out($info['content']);
        $info['content'] = str_replace("__ROOT__", __ROOT__, $info['content']);
        $info['content'] = str_replace("__PUBLIC__", __PUBLIC__, $info['content']);
        $info['content'] = str_replace("__APP__", __APP__, $info['content']);
        $info['content'] = str_replace("__URL__", __URL__, $info['content']);
        echo $info['content'];
    }
}

?>